package jacob;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

public class Pig_Wand extends ItemSword{

	public Pig_Wand(int par1, EnumToolMaterial par2EnumToolMaterial) {
		super(par1, par2EnumToolMaterial); }
		// TODO Auto-generated constructor stub
		public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
	        MovingObjectPosition Coord = par3EntityPlayer.rayTrace(300, 1);
	        if(Coord != null) {
	                Vec3 look = par3EntityPlayer.getLookVec();
	                par3EntityPlayer.setPosition(Coord.blockX - look.xCoord, Coord.blockY - look.yCoord + 2, Coord.blockZ - look.zCoord);
	        }
	        return par1ItemStack;
	}
	public void registerIcons(IconRegister iconReg)
		{
		  itemIcon = iconReg.registerIcon("iDTechModBase:PigWand");
	        
		}
	
	}